<?php



namespace App\Listeners\MyCategoryUpdateEvent;

use App\Events\MyCategoryUpdateEvent;
use App\Zesow\Cache\Impl\MyCategoryCache;

class CacheClearListener
{

    private $myCategoryCache;

    public function __construct(MyCategoryCache $myCategoryCache)
    {
        $this->myCategoryCache = $myCategoryCache;
    }

    public function handle(MyCategoryUpdateEvent $event)
    {
        $this->myCategoryCache->destroy($event->userId);
    }
}
